package com.idanchuang.count.service;

import com.idanchuang.count.service.api.request.command.CountBatchResetCommand;
import com.idanchuang.count.service.api.request.query.CountBatchQuery;
import com.idanchuang.count.service.api.request.query.CountQuery;

import java.util.Map;

/**
 * @author Richard_yyf
 * @version 1.0 2021/9/23
 */
public interface SimpleCountService {

    /**
     * 计数查询
     * @param countQuery query
     * @return 当前计数的值
     */
    Long query(CountQuery countQuery);

    /**
     * 批量计数查询
     * @param countBatchQuery query
     * @return <key: bizId, value: bizId当前计数的值>
     */
    Map<String, Long> batchQuery(CountBatchQuery countBatchQuery);

    /**
     * 对单一业务下的计数器做批量重置
     * @param countBatchResetCommand 重置命令
     */
    void batchResetCount(CountBatchResetCommand countBatchResetCommand);
}
